package com.xinqi.common.core.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author：yyzhen
 * @Package：com.xinqi.common.core.enums
 * @Project：xingqiclass-cloud-plus
 * @name：ComplaintTypeEnum
 * @Date：2023/4/24 10:34
 * @Filename：ComplaintTypeEnum
 */
public enum ComplaintConfigDisableFeatureEnum implements BaseEnum {

    CHAT("chat", "聊天功能"),

    ACCOUNT("account", "账号封禁"),

    INVALID_COMPLAINT("invalid_complaint", "投诉无效");

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    ComplaintConfigDisableFeatureEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static ComplaintConfigDisableFeatureEnum of(String code) {
        return BaseEnum.of(ComplaintConfigDisableFeatureEnum.class, code);
    }

    public static List<Map<String, String>> getSelectList() {
        List<Map<String, String>> list = new ArrayList<>();
        for (ComplaintConfigDisableFeatureEnum typeEnum : ComplaintConfigDisableFeatureEnum.values()) {
            Map<String, String> map = new HashMap<>();
            map.put("code", typeEnum.getCode());
            map.put("describe", typeEnum.getDescribe());
            list.add(map);
        }
        return list;
    }

}
